package fr.cephb.locustree.loaders;

import java.util.HashMap;
import java.util.Map;

import fr.cephb.locustree.MappedObject;

public class UCSCSnpLoader
	extends AbstractLTStreamLoader
	{

	
	@Override
	protected boolean make(String[] token)
		{
		//if(!token[1].equals("chr1")) return false;//TODO remove this
		
		this.chromosome=token[1];
		this.mappedObject=new MappedObject(token[4], token[4], Integer.parseInt(token[2]), Integer.parseInt(token[3]));
		Map<String,Object> json= new HashMap<String,Object>();
		json.put("strand", token[6]);
		json.put("refNCBI", token[7]);
		json.put("refUCSC", token[8]);
		json.put("observed", token[9]);
		json.put("molType", token[10]);
		json.put("class", token[11]);
		json.put("avHet", token[13]);
		json.put("func", token[15]);
		this.mappedObject.setJSON(json);
		this.keywords.add(mappedObject.getName());
		return true;
		}
	
	}
